<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>维修维护</title>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/admin_css/list_style.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/layui/css/layui.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/niubility.css"/>
		<script type="text/javascript" src="../../../resource/layui/layui.js"></script>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.css"/>
	</head>
	<body>
		
		<!--详情：弹出层-->
		<div class="popUp" id="popUp">
			<table class="table table-bordered table-hover"></table>
			<table class="table table-bordered table-hover"></table>
		</div>

		<div class="bs">
			<input type="button" id="totalSelection" value="全部选中" />
			<input type="button" id="sure" value="审核" />
		</div>

		<!--申请列表  展示区-->
		<table class="layui-table">
			<tbody id="infoBox"></tbody>
			<!--用来分页的div-->
			<div class="fenBox">
				<div id="pagination1"></div>
			</div>
		</table>
		<script type="text/javascript" src="../../../resource/js/jquery.min.js"></script>
		<!--静态路径: 应该放在 渲染列表 和 审核功能的前面 -->
		<script src="../../../resource/js/static_url.js"></script>
		<!-- 共同一套：生成信息列表 + 弹出层退回去的代码 -->
		<script src="../../../resource/js/admin_js/admin_review_list.js"></script>
		<!-- 审核功能： 运行使用 + 维修维护 -->
		<script src="../../../resource/js/admin_js/admin_review_two.js"></script>
		<script>
			//（1）渲染信息列表
            myAjax_list_popup(admin_repair,'1');
            //（2）详细信息
            function details(that){
                //ids=设备编号 ， 拿到开始时间
                var ids = $(that).attr("data-id");
                var time = $(that).attr("data-time");
                $.ajax({
                    url: admin_repair_details+ids+'/'+time,
                    type:"GET",
                    async: true,
                    dataType:"json",
                    success: function(info){
                        if(info.code != 0)
                        {
                            layui.use('layer', function(){
                                var layer = layui.layer;
                                layer.msg(info.msg, {skin:'tip_position',time:'3000'});
                            });
                            return;
                        }
                        var obj1 = info.data;
                        var str1 = "";
                        str1+=
                            '<tr>'+
                            '<td>设备类别</td>'+
                            '<td>设备名称</td>'+
                            '<td>设备编号</td>'+
                            '<td>经手人</td>'+
                            '<td>维修日期</td>'+
                            '</tr>'+
                            '<tr>'+
                            '<td>'+obj1.equipmentCategory+'</td>'+
                            '<td>'+obj1.equipmentName+'</td>'+
                            '<td>'+obj1.equipmentNo+'</td>'+
                            '<td>'+obj1.handMan+'</td>'+
                            '<td>'+obj1.repairDate+'</td>'+
                            '</tr>';
                        var str2 ="";
                        str2+=
                            '<tr>'+
                            '<td>维修或维护</td>'+
                            '<td>维修人员</td>'+
                            '<td>维修费用</td>'+
                            '<td>维修地点</td>'+
                            '<td>维修原因</td>'+
                            '</tr>'+
                            '<tr>'+
                            '<td>'+obj1.repairOr+'</td>'+
                            '<td>'+obj1.repairMan+'</td>'+
                            '<td>'+obj1.repairMoney+'</td>'+
                            '<td>'+obj1.repairPlace+'</td>'+
                            '<td>'+obj1.repairReason+'</td>'+
                            '</tr>';
                        $("#popUp table").eq(0).html(str1);
                        $("#popUp table").eq(1).html(str2);
                        //让内容以弹出层的方式显示出来。
                        $("#popUp").attr({"class":"popUpClick"});
                        // 动态计算 #popUp 的宽度
                        var width_fen = parseInt( $("#popUp").css("width") );
                        width_fen = 801;
                        $("#popUp")[0].style.marginLeft = -width_fen/2-120-60+'px';
                    },
                    error:function(){
                        layui.use('layer', function(){
                            var layer = layui.layer;
                            layer.msg('系统错误！！！', {skin:'tip_position',time:'3000'});
                        });
                    }
                }); //ajax结束

            }

            //（3）审核
            $("#sure").click(function(){
                two_review(admin_repair_review , admin_repair);
            });
		</script>
	</body>
	
</html>
